/*
* Copyright (c)  2017, ueboot.com
* All rights reserved.
* 2017-11-02 17:23:48
*/
package com.ueboot.weishop.service.finance.impl;

import com.ueboot.weishop.entity.finance.SettlementBatch;
import com.ueboot.core.repository.BaseRepository;
import com.ueboot.weishop.repository.finance.SettlementBatchRepository;
import com.ueboot.core.service.impl.BaseServiceImpl;
import com.ueboot.weishop.service.finance.SettlementBatchService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by yangkui  on 2017-11-02 17:23:48.
 * @author yangkui
 * @since 2.0 by autocode
 */
@Slf4j
@Service
public class SettlementBatchServiceImpl extends BaseServiceImpl<SettlementBatch> implements SettlementBatchService{
    @Autowired
    private SettlementBatchRepository settlementBatchRepository;

    @Override
    protected BaseRepository getBaseRepository() {
         return settlementBatchRepository;
    }

    @Override
    public SettlementBatch findTopByOrderBySettleDateDesc() {
        return settlementBatchRepository.findTopByOrderBySettleDateDesc();
    }

    @Override
    public List<SettlementBatch> findByStatusOrderByFirstInsertDesc(String status) {
        return settlementBatchRepository.findByStatusOrderByFirstInsertDesc(status);
    }

    @Override
    public SettlementBatch findTopByBatchNoOrderByFirstInsertDesc(String batchNo) {
        return this.settlementBatchRepository.findTopByBatchNoOrderByFirstInsertDesc(batchNo);
    }

}
